package com.scu.qingshi.common.exception.authorization;


import com.scu.qingshi.common.enums.ExceptionCodeEnum;
import com.scu.qingshi.common.exception.BaseException;

/**
 * 网络授权相关错误
 * @author qingshi
 */
public class AuthorizationException extends BaseException {

   private AuthorizationException(){};

   public static AuthorizationException dataException(String des){
      AuthorizationException authorizationException = new AuthorizationException();
      authorizationException.setDescription(des);
      authorizationException.setCode(ExceptionCodeEnum.DATA_ERROR);
      return authorizationException; 
   }

   public static AuthorizationException errorVerifyCodeException(String des){
      AuthorizationException authorizationException = new AuthorizationException();
      authorizationException.setDescription(des);
      authorizationException.setCode(ExceptionCodeEnum.FAIL);
      return authorizationException;
   }

   public static AuthorizationException duplicateRegisterException(String des){
      AuthorizationException authorizationException = new AuthorizationException();
      authorizationException.setDescription(des);
      authorizationException.setCode(ExceptionCodeEnum.DUPLICATE_SUBMIT);
      return authorizationException;
   }

}
